<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title>商品列表页</title>
	<link href="http://127.0.0.1/hdwy/wasai/Application/Index/View/Public/images/ico/favicon.ico" rel="shortcut icon" />
	<link rel="stylesheet" type="text/css" href="http://127.0.0.1/hdwy/wasai/Application/Index/View/Public/css/list.css"/>
	<link rel="stylesheet" type="text/css" href="http://127.0.0.1/hdwy/wasai/Application/Index/View/Public/css/common.css"/>
</head>
<body>
	<!--公共头部-->
	<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
	<!--登陆注册/购物车部分 -->
	<div class="top fl">
		<div class="logins">
			    <?php if(!$_SESSION['uid']){ ?>
			<div class="logins-left fl">
				<a href="<?php echo U('Index/Login/index');?>">登录</a>
				<a href="<?php echo U('Index/Login/register');?>">注册</a>
			</div>
			<?php }else{ ?>
			<div class="user fl">
				<a href=""><img src="<?php echo $_SESSION['face'];?>"/></a>
				<span><?php echo $_SESSION['username'];?></span>
				<a href="<?php echo U('Index/Login/out');?>" class="out">退出</a>
			</div>
			<?php } ?>
			<div class="buycar fr">
				<div class="buycar-left fl">
					<img src="http://127.0.0.1/hdwy/wasai/Application/Index/View/Public/images/ico/buycar.png" alt="" />
				</div>
				<a href="#">购物车<span class="num">0</span>件</a>
			</div>
		</div>
	</div>
	<!--end-->
	
	<!--首页分类/logo/搜索栏部分-->
	<div class="header fl">
		<div class="classification">
			<div class="house fl">
				<a href="<?php echo U('Index/index');?>"></a>
			</div>
			<!--左侧分类-->
			<ul class="classA fl">
				<li><a href="<?php echo U('Category/index');?>">市集</a></li>
				<li><a href="">新品</a></li>
				<li><a href="">热卖</a></li>
				<li><a href="">闪购</a></li>
				<li><a href="">定制</a></li>
			</ul>
			<!--logo-->
			<div class="logo">
				<a href="<?php echo U('Index/index');?>"><img src="http://127.0.0.1/hdwy/wasai/Application/Index/View/Public/images/ico/logo.png"/></a>
			</div>
			<form action="" method="post" class="search fr">
				<input type="text" placeholder="请输入要搜索的关键词" class="text"/>
				<input type="submit" value="" class="submit"/>
			</form>
			<!--右侧分类-->
			<ul class="classB">
				<li><a href="">动态</a></li>
				<li><a href="">画报</a></li>
				<li><a href="">画报</a></li>
			</ul>
		</div>
	</div>
	<!--end-->



	
	<!--分类及子分类-->
	<div class="category fl">
		<div class="category_in">
			
			<div class="bnd fl">	
				        <?php
        //初始化
        $hd['list']['m'] = array(
            'first' => false,
            'last'  => false,
            'total' => 0,
            'index' => 0
        );
        if (empty($fatCate)) {
            echo '';
        } else {
            $listId = 0;
            $listShowNum=0;
            $listNextId=0;
            foreach ($fatCate as $m) {
                //开始值
                if ($listId<0) {
                    $listId++;
                    continue;
                }
                //步长
                if($listId!=$listNextId){$listId++;continue;}
                //显示条数
                if($listShowNum>=100)break;
                //第几个值
                $hd['list'][m]['index']++;
                //第1个值
                $hd['list'][m]['first']=($listId == 0);
                //最后一个值
                $hd['list'][m]['last']= (count($fatCate)-1 <= $listId);
                //总数
                $hd['list'][m]['total']++;
                //增加数
                $listId++;
                $listShowNum++;
                $listNextId+=1
                ?>
				<span class="category_grand">				
					<a href="<?php echo U('Index/Category/index');?>">    <?php if($hd['list']['m']['first']){ ?><?php echo $m['cname'];?><?php } ?></a>
					    <?php if(!($hd['list']['m']['first']) && !($hd['list']['m']['last'])){ ?><span>/&nbsp;</span><a href="<?php echo U('Index/List/index',array('cid'=>$m[cid]));?>"><?php echo $m['cname'];?></a><?php } ?>
				</span>
				    <?php if($hd['list']['m']['last']){ ?>
					<p class="category_father"><?php echo $m['cname'];?></p>
				<?php } ?>	
				<?php }}?>
			</div>
			
			<ul class="category_son fl">
				<?php foreach ($sonCate as $k=>$v){?>
				<li><a href="<?php echo U('Index/List/index',array('cid'=>$v[cid]));?>"><?php echo $v['cname'];?></a></li>		
				<?php }?>
			</ul>
		</div>
	</div>
	<!--end-->
	
	<!--最热/最新切换-->
	<div class="hot fl">
		<div class="hot_in">
			<div class="hot_btn fr">
				<a href="javascript:;" class="lefton">最热</a>
				<a href="javascript:;" class="righton">最新</a>
			</div>
		</div>
	</div>
	<!--end-->
	
	<!--商品价格-->
<?php foreach ($tempFinalAttr as $k=>$v){?>
	<div class="xuanze fl">
		<div class="xuanze_in">
			<p><?php echo $v['name'];?>:</p>
			<ul>
				<?php 
					//赋值给临时变量为了不破坏$param
					$temp = $param;
					//为了不限而准备的
					$temp[$k] = 0;
				 ?>
				<li><a href="<?php echo U('List/index',array('cid'=>$_GET['cid'],'param'=>implode('_',$temp)));?>"     <?php if($param[$k]==0){ ?>class="hover"<?php } ?> >全部</a></li>
				<?php foreach ($v['value'] as $kk=>$vv){?>
					<?php 
						$temp[$k] = $vv['said'];
					 ?>					
					<li><a href="<?php echo U('List/index',array('cid'=>$_GET['cid'],'param'=>implode('_',$temp)));?>"     <?php if($param[$k]==$vv['said']){ ?>class="hover"<?php } ?> ><?php echo $vv['savalue'];?></a></li>
				<?php }?>
			</ul>
		</div>
	</div>
<?php }?>
	<!--end-->
	
	<!--商品列表-->
	<div class="shiji_list fl">
		<div class="list_in">
			<?php foreach ($shops as $k=>$v){?>
			<div class="shiji_item">
				<a href="<?php echo U('Index/Content/index',array('sid'=>$v['sid']));?>" class="list_img"><img src="http://127.0.0.1/hdwy/wasai/<?php echo $v['pic'];?>"/></a>
				<a href="<?php echo U('Index/Content/index',array('sid'=>$v['sid']));?>" class="list_content"><?php echo $v['sname'];?></a>
				<div class="list_price">
					<div class="list_border"></div>
					<p>￥<?php echo $v['shopprice'];?></p>
				</div>
			</div>
			<?php }?>
		</div>
	</div>
	<!--end-->
	
	<!--分页部分-->
	<div class="page fl">
		<div class="hdpage"></div>
	</div>
	<!--end-->
	
	<!--更多精彩-->
	<div class="more_out fl">
		<div class="cin"></div>
		<div class="more_in">
			<div class="footerTop1 fl">
				<a href="">市集</a>•<a href="">动态</a>
			</div>
			<div class="footerTop2 fl">
				<p><?php echo $fatCate[1]['cname'];?></p>
				<ul>
					<?php foreach ($sonCate as $k=>$v){?>
					<li><a href="<?php echo U('Index/List/index',array('cid'=>$v[cid]));?>"><?php echo $v['cname'];?></a></li>
					<?php }?>
				</ul>
			</div>
			<ul class="footerTop3 fr">
				<?php foreach ($topCate as $k=>$v){?>
					<li><a href=""><?php echo $v['cname'];?></a></li>		
				<?php }?>
			</ul>
		</div>
	</div>
	<!--end-->
	
	<!--间隔-->
	<div class="clear fl"></div>
	<!--end-->
	
	<!--底部信息-->
	<div class="bottom fl">
		<div class="footer">
			<div class="footitle fl">
				<p>高端定制上哇塞网</p>
			</div>
			<div class="footernav fl">
				<p class="box">
					<a href="">关于我们</a>
					<a href="">联系我们</a>				
					<a href="">媒体报道</a>				
					<a href="">创意画报</a>				
					<a href="">招贤纳士</a>				
					<a href="">版权保护</a>
					<a href="">用户条款</a>				
					<a href="">隐私声明</a>				
					<a href="">友情链接</a>				
					<a href="">网站地图</a>
					<a href="">帮助中心</a>				
					<a href="">手工客</a>
				</p>
			</div>
			<div class="footermsg fl">
				<p>北京光年创艺信息技术有限公司 WowSai.com Copyright© 2008-2013 [京ICP备10020900][京公网安备11010502026420][京ICP证090011号]</p>
			</div>
			<div class="footerpic fl">
				<div class="botpic">
					<img src="http://127.0.0.1/hdwy/wasai/Application/Index/View/Public/images/ico/bot1.png" alt="" />
					<img src="http://127.0.0.1/hdwy/wasai/Application/Index/View/Public/images/ico/bot2.png" alt="" />
					<img src="http://127.0.0.1/hdwy/wasai/Application/Index/View/Public/images/ico/bot3.png" alt="" />
				</div>
			</div>
		</div>
	</div>
	<!--end-->		
	</body>
</html>




















